CPC Compiling threads to events efficiently

نویسنده

  • Gabriel Kerneis
چکیده

We present Continuation Passing C (CPC), a programming language designed for writing concurrent systems. It features very lightweight threads, both cooperatively or preemptively scheduled, which are compiled to highly-efficient event-loop code. Its compilation passes have been proven correct. CPC has been used to write Hekate, a BitTorrent seeder able to sustain thousands of simultaneously connected peers.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

CPC: programming with a massive number of lightweight threads

Threads are a convenient and modular abstraction for writing concurrent programs. Unfortunately, threads, as they are usually implemented, are fairly expensive, which often forces the programmer to use a somewhat coarser concurrency structure than he would want to. The standard alternative to threads, event-loop programming, allows much lighter units of concurrency; however, event-loop programm...

متن کامل

Continuation-Passing C, compiling threads to events through continuations

In this paper, we introduce Continuation Passing C (CPC), a programming language for concurrent systems in which native and cooperative threads are unified and presented to the programmer as a single abstraction. The CPC compiler uses a compilation technique, based on the CPS transform, that yields efficient code and an extremely lightweight representation for contexts. We provide a proof of th...

متن کامل

Compiling threads to events through continuations

In this paper, we introduce Continuation Passing C (CPC), a programming language for concurrent systems in which native and cooperative threads are unified and presented to the programmer as a single abstraction. The CPC compiler uses a compilation technique, based on the CPS transform, that yields efficient code and an extremely lightweight representation for contexts. We provide a proof of th...

متن کامل

Compiling Dataaow into Threads Eecient Compiler-controlled Multithreading for Lenient Parallel Languages Compiling Dataaow into Threads Eecient Compiler-controlled Multithreading for Lenient Parallel Languages Compiling Dataaow into Threads Eecient Compiler-controlled Multithreading for Lenient Parallel Languages

Powerful non-strict parallel languages require fast dynamic scheduling. This thesis explores how the need for multithreaded execution can be addressed as a compilation problem, to achieve switching rates approaching what hardware mechanisms might provide. Compiler-controlled multithreading is examined through compilation of a lenient parallel language, ID90, for a threaded abstract machine, TAM...

متن کامل

Generating events with style

Threads and events are two common abstractions for writing concurrent programs. Because threads are often more convenient, but events more efficient, it is natural to want to translate the former into the latter. However, whereas there are many different event-driven styles, existing translators often apply ad-hoc rules which do not reflect this diversity. We analyse various control-flow and da...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2010